Skip to content

feat(store): watermark persistence + enabled-repo enumeration (RIG-2883 T4) - #705

Open
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-forge/rig-2883-t4-store
Open

feat(store): watermark persistence + enabled-repo enumeration (RIG-2883 T4)#705
rigel-mintaka wants to merge 2 commits into
mainfrom
compass-forge/rig-2883-t4-store

Conversation

@rigel-mintaka

@rigel-mintaka rigel-mintaka commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

This PR is part of a stack containing 2 PRs:

  1. main
  2. "feat(store): watermark persistence + enabled-repo enumeration (RIG-2883 T4)" (this PR)
  3. feat(store): recency-guard write-path threading for forge_updated_at (RIG-2883) #710

The board webhook lane's durable state, additive on the pre-live 0001_init.sql.

  • forge_repo_subscriptions gains swept_updated_at (the per-repo updated-at watermark; NULL = never swept) and list_etag (the conditional-GET etag for the repo LIST walk), plus LoadForgeRepoWatermark/StoreForgeRepoWatermark (advance-after-sink; unknown coordinate reads zero/empty, store on a missing row is ErrNotFound), ListEnabledForgeRepos (ascending cross-coordinate enumeration for the reconciler), and IsEnabledForgeRepo (the point membership check the webhook arm gates on).
  • issues gains forge_updated_at TIMESTAMPTZ, INERT this slice — the OQ-6(a) recency-guard column. T4a threads its write path and makes the upsert conditional; the bare column is a no-op until then.

The forge_list_cursors table and its store methods (ForgeListCursor/UpsertForgeListCursorPage/PruneForgeListCursorPages) stay: they retire atomically with their serve.go poll-driver consumer in T5, so this slice never breaks the tree build. pgtest covers the watermark round-trip, coordinate isolation, enabled-repo enumeration + point membership, and that the edited migration applies on a fresh database with the three new columns present.

Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson matt@rigel.build

…83 T4)

The board webhook lane's durable state, additive on the pre-live `0001_init.sql`.

- `forge_repo_subscriptions` gains `swept_updated_at` (the per-repo updated-at watermark; NULL = never swept) and `list_etag` (the conditional-GET etag for the repo LIST walk), plus `LoadForgeRepoWatermark`/`StoreForgeRepoWatermark` (advance-after-sink; unknown coordinate reads zero/empty, store on a missing row is `ErrNotFound`), `ListEnabledForgeRepos` (ascending cross-coordinate enumeration for the reconciler), and `IsEnabledForgeRepo` (the point membership check the webhook arm gates on).
- `issues` gains `forge_updated_at TIMESTAMPTZ`, INERT this slice — the OQ-6(a) recency-guard column. T4a threads its write path and makes the upsert conditional; the bare column is a no-op until then.

The `forge_list_cursors` table and its store methods (`ForgeListCursor`/`UpsertForgeListCursorPage`/`PruneForgeListCursorPages`) stay: they retire atomically with their `serve.go` poll-driver consumer in T5, so this slice never breaks the tree build. pgtest covers the watermark round-trip, coordinate isolation, enabled-repo enumeration + point membership, and that the edited migration applies on a fresh database with the three new columns present.

Spec-impact: none. Refs RIG-2883
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

RIG-2883

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

Compass engineering docs preview: https://compass-forge-rig-2883-t4-st.compass-eng-docs.pages.dev

Deployed from compass-forge/rig-2883-t4-store at 3fde8b7.

…cks (RIG-2883 T4)

ListEnabledForgeRepos / IsEnabledForgeRepo key on repo alone, matching
the frozen repo-keyed ingest seam, while the watermark methods are
coordinate-keyed (provider, host, repo). Unambiguous in a github.com-only
deployment; documents the latent cross-coordinate ambiguity so a future
multi-host enablement threads (provider, host) through the seam first.

Refs RIG-2883
Co-authored-by: Matt Wilkinson <matt@rigel.build>
@rigel-mintaka
rigel-mintaka marked this pull request as ready for review August 28, 2026 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant